/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ecouteurs;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.swing.JCheckBox;
import javax.swing.JTextField;

/**
 *
 * @author Baptiste
 */
public class EcouteurPheromones implements MouseListener{
    
    private JCheckBox enable;
    private JCheckBox attraction;
    private JTextField lifespan;
    private JCheckBox ephemere;
    
    public EcouteurPheromones(JCheckBox enable, JCheckBox ephemere, JTextField lifespan, JCheckBox attraction){
        this.enable = enable;
        this.attraction = attraction;
        this.lifespan = lifespan;
        this.ephemere = ephemere;
    }

    public void mouseClicked(MouseEvent e) {
        if (!this.enable.isSelected()){
            this.attraction.setSelected(false);
            this.attraction.setEnabled(false);
            this.lifespan.setText("0");
            this.lifespan.setEnabled(false);
            this.ephemere.setSelected(false);
            this.ephemere.setEnabled(false);
        }
        else{
            this.attraction.setSelected(false);
            this.attraction.setEnabled(true);
            this.lifespan.setText("100");
            this.lifespan.setEnabled(true);
            this.ephemere.setSelected(true);
            this.ephemere.setEnabled(true);
        }
    }

    public void mousePressed(MouseEvent e) {
    }

    public void mouseReleased(MouseEvent e) {
    }

    public void mouseEntered(MouseEvent e) {
    }

    public void mouseExited(MouseEvent e) {
    }

}
